<script>
    $(function() {
        $("a").button();
        $("a").click(function() { return true; });
    });
</script>
<div style="background-color: #222222;height: 100%" align="center">
    <div style="width: 90%;height: 100%;background-color:#eeeeee;overflow: auto" align="center" class="ui-widget ui-corner-all">
        <div style="width: 100%;padding: 10px;" align="left"><INPUT class="ui-button ui-widget ui-state-default ui-corner-all" TYPE="button" VALUE="กลับ" onClick="history.go(-1);return true;"></div>
        <form method="post" action="search">
            <br>
            <table width="700" class="ui-widget ui-widget-content">
                <thead><tr class="ui-widget-header"><td colspan="6" align="center">ค้นหาประวัติคนไข้</td></tr></thead>
                <tbody>
                    <tr>
                        <td align="center">ชื่อ</td><td align="center">นามสกุล</td><td align="center">เพศ</td><td align="center">วันเดือนปีเกิด</td><td align="center">เบอร์โทรศัพท์</td>
                    </tr>
                    <?php
                    foreach($patient_list as $item) {
                        echo "<tr>";
                        echo "<td>".$item['p_fname']."</td>";
                        echo "<td>".$item['p_lname']."</td>";

                        if($item['p_sex']==1)
                            $sex =  "ชาย";
                        else
                            $sex = "หญิง";

                        echo "<td>".$sex."</td>";
                        echo "<td>".$item['p_bday']."</td>";
                        echo "<td>".$item['p_phone']."</td>";
                        echo "<td>".html::anchor("../patient/profile/".$item['p_id'],html::chars(" ตรวจสอบประวัติ ")) ."</td>";
                        echo "</tr>";
                    }
                    ?>
                </tbody>
            </table>
        </form>
        <br>        
    </div>    
</div>

